// /**
//  * @file bsp_tim.c
//  * @brief 硬件定时器 TIM 封装API
//  * @author wangh (wanghuan3037@fiberhome.com)
//  * @version 1.0
//  * @date 2020-06-05
//  * @copyright Copyright (c) 2020  烽火通信
//  ***************************************************************
//  * @par 修改日志:
//  * <table>
//  * <tr><th>Date       <th>Version  <th>Author  <th>Description
//  * <tr><td>2020-06-05 <td>1.0      <td>wangh   <td>内容
//  * </table>
//  */
// #include "bsp_tim.h"

// #undef LOG_LEVEL_
// #define LOG_LEVEL_ 	LOG_LVL_DEBUG
// #include "bsp_log.h"


// /**
//  * @brief  \n
//  * 通用定时器(TIM2、TIM3、TIM4和TIM5) \n
//  * 基本定时器(TIM6 和TIM7) \n
//  * 高级控制定时器(TIM1和TIM8)
//  * @param  obj         Param
//  * @param  timId       Param
//  */
// void TimInit( Tim_t *obj, TimId_t timId )
// {





//     TIM_TimeBaseInitTypeDef  TIM_TimeBaseInitStructure;
//     NVIC_InitTypeDef NVIC_InitStructure;

//     RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM3, ENABLE); //时钟使能

//     TIM_TimeBaseInitStructure.TIM_Period = arr; //设置在下一个更新事件装入活动的自动重装载寄存器周期的值,计数到5000为500ms
//     TIM_TimeBaseInitStructure.TIM_Prescaler =psc; //设置用来作为TIMx时钟频率除数的预分频值  10Khz的计数频率  
//     TIM_TimeBaseInitStructure.TIM_ClockDivision = 0; //设置时钟分割:TDTS = Tck_tim
//     TIM_TimeBaseInitStructure.TIM_CounterMode = TIM_CounterMode_Up;  //TIM向上计数模式
//     TIM_TimeBaseInit(TIM3, &TIM_TimeBaseInitStructure); //根据TIM_TimeBaseInitStruct中指定的参数初始化TIMx的时间基数单位


//     TIM_OCInitTypeDef TIM_OCInitStructure;
//     TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM1;
//     TIM_OCInitStructure.TIM_OCIdleState = TIM_OCIdleState_Reset;
//     TIM_OCInitStructure.TIM_OCNIdleState = TIM_OCNIdleState_Set;
//     TIM_OCInitStructure.TIM_OCPolarity = TIM_OCPolarity_High;
//     TIM_OCInitStructure.TIM_OCNPolarity = TIM_OCNPolarity_High;
//     TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable;
//     TIM_OCInitStructure.TIM_OutputNState = TIM_OutputNState_Disable;
//     TIM_OCInitStructure.TIM_Pulse = 0;
//     TIM_OC4Init(TIM3, &TIM_OCInitStructure);





//     TIM_ITConfig( TIM3, TIM_IT_Update, ENABLE );
//     NVIC_InitStructure.NVIC_IRQChannel = TIM3_IRQn;  //TIM3中断
//     NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 10;  //先占优先级0级
//     NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;  //从优先级3级
//     NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; //IRQ通道被使能
//     NVIC_Init(&NVIC_InitStructure);  //根据NVIC_InitStruct中指定的参数初始化外设NVIC寄存器

//     TIM_Cmd(TIM3, ENABLE);  //使能TIMx外设
// }



// /*********** (C) COPYRIGHT 2020 FiberHome *****END OF FILE****/
